package com.ms.config.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.monitor.MonitorUtil;
import com.ms.MsConfig;

@Configuration
public class MonitorConfig {

    @Autowired
    private Environment env;
	
    @Bean
	public MonitorUtil monitorUtil() throws Exception {
		MsConfig.setAuthInfo(env.getProperty("project.client.id"), env.getProperty("project.sercret"));
		MsConfig.setServerIdMonitor(env.getProperty("service.id.monitor"));
		MonitorUtil monitorUtil = new MonitorUtil(env);
		return monitorUtil;
	}
}
